home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / tcega.arc / GPSHADE.C < prev    next >
Text File  |  1986-02-25  |  1KB  |  57 lines

  1. /*                                                                            */
  2. /*      EGA Graphic Primitive for Turbo Pascal 3.01A, Version 01FEB86.        */
  3. /*      (C) 1986 by Kent Cedola, 2015 Meadow Lake Ct., Norfolk, VA, 23518     */
  4. /*                                                                            */
  5. /*      Description: Set the current style for line drawing primitives.       */
  6. /*      Setting the shading will set the shading flag on and setting the      */
  7. /*      current color will reset it zero. If the shading flag is zero then    */
  8. /*      the current color will be used, else the line style.                  */
  9. /*                                                                            */
  10.  
  11. void GPSHADE(shade)
  12.   char *shade;
  13. {
  14.   extern char *GDSHADE;
  15.   extern char GDSHAD1[64];
  16.  
  17.   int  mx,my,x,y,x1,y1,i;
  18.  
  19.   GDSHADE = shade;
  20.  
  21.   mx = shade[0];
  22.   my = shade[1];
  23.  
  24.   x  = 0;
  25.   y  = 0;
  26.   x1 = 0;
  27.   y1 = 0;
  28.  
  29.   for (i = 0; i < 64; i++)
  30.     {
  31.     if (x1 == 8)
  32.       {
  33.       x1 = 0;
  34.       y1 = y1 + 1;
  35.       y  = y + 1;
  36.       };
  37.  
  38.     if (x == mx)
  39.       x = 0;
  40.  
  41.     if (y == my)
  42.       y = 0;
  43.  
  44.     GDSHAD1[y1*8+x1+2] = shade[y*mx+x+2];
  45.  
  46.     x  = x + 1;
  47.     x1 = x1 + 1;
  48.  
  49.     };
  50.  
  51.   GDSHAD1[0] = 8;
  52.   GDSHAD1[1] = 8;
  53.  
  54.   GPSHAD1();
  55.  
  56. }
  57.